package com.sunelec.service.Imp;

import com.sunelec.mapper.PowerMapper;
import com.sunelec.mapper.RelationshipMapper;
import com.sunelec.pojo.Power;
import com.sunelec.pojo.Relationship;
import com.sunelec.service.CentralizedService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: 郑明利
 * @Description:
 * @Date: Create in 1:02 2018/06/03
 * @Modified By:
 */
@Service
public class CentralizedServiceImpl implements CentralizedService{

    @Autowired
    private RelationshipMapper relationshipMapper;

    @Autowired
    private PowerMapper powerMapper;

    @Override
    public List<Relationship> getRelationshipWithType3(String username) {
        return relationshipMapper.selectByUserLevel3(username);
    }

    @Override
    public List<Relationship> getRelationshipWithType2(String username) {
        return relationshipMapper.selectByUserLevel2(username);
    }

    @Override
    public List<Power> getRelationshipWithType1() {
        return powerMapper.selectAllPower();
    }
}
